"Call the command in `which-key--prefix-help-cmd-backup'.
Usually this is `describe-prefix-bindings'."
(interactive)
- (let ((which-key-inhibit t))
+ (let ((which-key-inhibit t)
+ (popup-showing (which-key--popup-showing-p)))
(which-key--hide-popup-ignore-command)
- (cond ((eq which-key--prefix-help-cmd-backup
- 'describe-prefix-bindings)
- ;; This is essentially what `describe-prefix-bindings' does
- (describe-bindings
- (kbd (which-key--current-key-string))))
+ (cond ((and (eq which-key--prefix-help-cmd-backup
+ 'describe-prefix-bindings)
+ ;; If the popup is not showing, we call
+ ;; `describe-prefix-bindings' directly.
+ popup-showing)
+ ;; This is essentially what `describe-prefix-bindings' does. We can't
+ ;; use this function directly, because the prefix will not be correct
+ ;; when we enter using `which-key-C-h-dispatch'.
+ (describe-bindings (kbd (which-key--current-key-string))))
((functionp which-key--prefix-help-cmd-backup)
(funcall which-key--prefix-help-cmd-backup)))))